
// 上拉加载
mui.init({
    pullRefresh : {
        container: '#refresh-container',
        up: {
            height: 50,
            auto: false,
            contentrefresh: "正在加载...",
            contentnomore: '没有更多数据了',
            callback: function() {
                setTimeout(() => { this.endPullupToRefresh() }, 3000)
            } 
        },
        down: {
            height: 50,
            auto: false,
            contentdown : "下拉刷新",
            contentover : "释放刷新",
            contentrefresh : "正在刷新...",
            callback : function() {
                setTimeout(() => { mui('#refresh-container').pullRefresh().endPulldownToRefresh(); }, 3000)
                
            } 
          }
    }
})

// 排序
$('.switch').on('click', function() {
    $(this).children('i').toggleClass('active')
})

// 选择课程
$('.select-course').click(function() {

    var picker = new mui.PopPicker()

    // 课程数据
    const list = [
        { value:'schj', text:'市场环境' },
        { value:'cpld', text:'产品亮点' },
        { value:'ztmn', text:'展厅模拟' }
    ]
    picker.setData(list)

    picker.show(function (selectItems) {
        console.log(selectItems)
    })
})

// 选择区域
$('.select-area').click(function() {

    var picker = new mui.PopPicker()

    // 区域数据
    const list = [
        { value:'hb', text:'华北一区' },
        { value:'hn', text:'华南一区' },
        { value:'hd', text:'华东一区' }
    ]
    picker.setData(list)

    picker.show(function (selectItems) {
        console.log(selectItems)
    })
})